package fnord.jovian.tango;

import fnord.jovian.TheBoard;
import fnord.jovian.tango.TheAssemblyLayout.*;

public class TheGameMenu extends TheMenu {
	
	private TheBoard _board;

	public TheGameMenu(TheBoard board) {
		super(300,300,board);
		_board = board;
		TheAssemblyLayout layout = new TheAssemblyLayout(TheAssemblyOrientation.VERTICAL);
		setTheLayout(layout);
		this.addComponent(new TheButton("Resume Game", 200, 30, new TheResumeListener()));
		this.addComponent(new TheButton("Settings", 200, 30, new TheSettingsListener()));
		this.addComponent(new TheButton("Quit Game", 200, 30, new TheQuitGameListener()));
		this.addComponent(new TheButton("Quit FNORD", 200, 30, new TheQuitListener()));
	}
	
	private class TheResumeListener implements TheListener {
		public void doAction() {
			_board.toggleMenu();
		}
	}

	private class TheSettingsListener implements TheListener {
		public void doAction() {
			_board.toggleSettings();
		}
	}

	private class TheQuitGameListener implements TheListener {
		public void doAction() {
			System.exit(0);
		}
	}

	private class TheQuitListener implements TheListener {
		public void doAction() {
			System.exit(0);
		}
	}

}
